<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>数组练习2</title>
	</head>
	<body>
		<p id="demo">单击按钮向数组添加元素。</p>
		<button onclick="myFunction()">点我</button>
	<script>
			function myFunction(){
			var fruits=["Banana","Orange","Apple","Mango"];
			fruits.splice(2,0,"Wang");
			var x=document.getElementById("demo");
			x.innerHTML=fruits;
		}
	</script>
	</body>
</html>
